package cn.chaohi.common;

/**
 * 状态码枚举.
 * @author Yin Yong Gang
 * Date:2018-6-6
 */
public enum CodeEnum {

	SUCCESS(0, "成功"), 
	REQUEST_PARAM_NOT_NULL(2,"请求参数不能为空"),
	REQUEST_PARAM_ERROR(3,"请求参数格式有误"),
	ACCESS_TOKEN_INVALID(2, "会话失效,请重新登录"),
	
	/*
	 * 升级管理 (10000)
	 */
	MARKET_ID(10000, "超市ID不能为空"),
	MARKET_STORE_ID(10001, "超市门店ID不能为空"),
	WIFI_MAC(10002,"车辆wifi_mac不能为空"),
	OLD_VERSION(10003, "车辆老版本号不能为空"),
	PART_CONFIG_ISNULL(10004, "部分升级,但部分配置项信息为空,请确认."),
	
	
	/**
	 * 返回结果 (20000)
	 */
	VERSION_CLOSE(20000, "升级关闭中"),
	ALL_VERSION(20001, "没有要升级/降级的全量版本(全量升级)"),
	PLUS_VERSION(20001, "没有要升级的增量版本(增量升级)"),
	
	/*
	 * 状态上报参数 (30000)
	 */
	REPORT_MARKET_ID(30000, "超市ID不能为空"),
	REPORT_MARKET_STORE_ID(30001, "超市门店ID不能为空"),
	REPORT_WIFI_MAC(30002,"车辆wifi_mac不能为空"),
	REPORT_VERSION(30003, "上报版本号不能为空"),
	REPORT_PROCESSTYPE(30005, "动作名称不能为空"),
	REPORT_PROCESSVALUE(30006, "状态值不能为空"),
	
	FAIL(400,"fail"),//失败
	UNAUTHORIZED(401,"未认证"),//未认证（签名错误）
	NOT_FOUND(404,"接口不存在"),//接口不存在
	PARAM_ERROR(406,"参数错误!"),//参数错误
	ACCOUNT_NOT_FOUND(1001,"账户异常!"),//账户异常
	HI_COIN_NUM_LITTLE(1002,"嗨币余额不足!"),//嗨币余额不足
	SERVER_EXCEPTION(9001,"系统异常!"),//参数错误
	COIN_GET_CLOSE(9002,"嗨币获取关闭!"),//参数错误
	COIN_CASH_CLOSE(9002,"嗨币提现未开启!"),//参数错误
	COIN_RULE_CLOSE(9003,"当前嗨币不符合规则!"),//参数错误
	INTERNAL_SERVER_ERROR(500,"服务器内部错误"),//服务器内部错误
	GLOUD_STORAGE_API_SERVER_ERROR(20016,"云服务器异常"),
	DEC_FAIL(9004, "数据解密失败"),
	/*
	 * 辅助类
	 */
	API_SERVER_ERR(20000,"api server error"),
	OBJECT_TO_MAP_ERROR(20001,"object to map error"), 
	MANAGER_API_SERVER_ERROR(20002,"manager api server error");
	
	private int resultCode;
	private String errMsg;
	
	private CodeEnum(int resultCode, String errMsg) {
		this.resultCode = resultCode;
		this.errMsg = errMsg;
	}

	public int getResultCode() {
		return resultCode;
	}

	public void setResultCode(int resultCode) {
		this.resultCode = resultCode;
	}

	public String getErrMsg() {
		return errMsg;
	}

	public void setErrMsg(String errMsg) {
		this.errMsg = errMsg;
	}
}
